ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Newt_Egg Class Reference

The newt egg class - in pond. More...

#include <Newt.h>

Inheritance diagram for Newt_Egg:
Newt_Base TAnimal TALMaSSObject Newt_Larva

Public Member Functions

 Newt_Egg (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib)
 Newt_Egg constructor. More...
 
void ReInit (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib)
 ReInit for object pool. More...
 
 ~Newt_Egg ()
 Newt destructor. More...
 
virtual void Init ()
 Newt_Egg Initialisation. More...
 
virtual void Step (void)
 Newt_Egg Step code. This is called continuously until all animals report that they are 'DONE'. More...
 
void InternalPesticideHandlingAndResponse ()
 For handlng of class-specific pesticide effects. More...
 
- Public Member Functions inherited from Newt_Base
 Newt_Base (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib)
 Newt constructor. More...
 
void Init (vector< unsigned > a_pond, Newt_Population_Manager *a_NPM, bool a_reproinhib)
 Intitialise object. More...
 
void ReInit (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib)
 ReInit for object pool. More...
 
 ~Newt_Base ()
 Newt destructor. More...
 
virtual int WhatState ()
 Returns the state number for display purposes. More...
 
TTypeOfNewtState st_Develop (void)
 Behavioural state development - does nothing in the base class. More...
 
TTypeOfNewtState st_Movement (void)
 Behavioural state movement - does nothing in the base class. More...
 
void st_Dying (void)
 Behavioural state dying. More...
 
virtual void BeginStep (void)
 The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per timestep. More...
 
virtual void EndStep (void)
 The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per timestep. More...
 
unsigned GetAge ()
 A typical interface function - this one returns the Age as an unsigned integer. More...
 
void SetAge (unsigned a_age)
 A typical interface function - this one sets the Age as an unsigned integer. More...
 
unsigned GetHomePond ()
 A typical interface function - this one returns the home pond reference as an unsigned integer. More...
 
void SetHomePond (unsigned a_pond)
 A typical interface function - this one sets the home pond reference as an unsigned integer. More...
 
void InternalPesticideHandlingAndResponse (double)
 For handlng of class-specific pesticide effects. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
virtual bool OnFarmEvent (FarmToDo)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Static Public Attributes

static double m_EggPPPThreshold = cfg_NewtEggPPPToxTrigger.value()
 The threshold for effect of PPP on eggs. More...
 
static double m_EggPPPElimRate = cfg_NewtEggPPPToxEliminationRate.value()
 The daily proportion of PPP body burden that is not eliminated for eggs. More...
 
static double m_EggPPPEffectProbability = cfg_NewtEggPPPEffectProbability.value()
 The daily probability of effect if above m_EggPPPThreshold for eggs. More...
 
- Static Public Attributes inherited from Newt_Base
static double m_EggDevelopmentDDTotal = cfg_NewtEggDevelTotal.value()
 
static double m_EggDevelopmentDDParameter = cfg_NewtEggDevelDDParameter.value()
 
static double m_JuvenileDevelopmentSize = cfg_NewtJuvenileDevelSize.value()
 
static double m_EggMortalityChance = cfg_NewtEggMortalityChance.value()
 
static double m_JuvenileMortalityChance = 0.0
 
static double m_AdultMortalityChance = 0.0
 
static bool m_test_pesticide_egg = cfg_Newt_Test_Pesticide_Egg.value()
 Flags to record whether we are in pesticide testing mode. More...
 
static bool m_test_pesticide_larva = cfg_Newt_Test_Pesticide_Larva.value()
 
static bool m_test_pesticide_terrestrial = cfg_Newt_Test_Pesticide_Terrestrial.value()
 

Protected Member Functions

virtual TTypeOfNewtState st_Develop (void)
 Behavioural state development. More...
 
virtual TTypeOfNewtState st_NextStage (void)
 Egg hatch. More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

double m_AgeDegrees
 
- Protected Attributes inherited from Newt_Base
TTypeOfNewtState m_CurrentNewtState
 Variable to record current behavioural state. More...
 
unsigned m_Age
 
vector< unsigned > m_pondlist
 
Newt_Population_Managerm_OurPopulationManager
 This is a time saving pointer to the correct population manager object. More...
 
double m_body_burden
 The current PPP body burden for use in pesticide testing mode. More...
 
bool m_reproductiveinhibition
 A flag to indicate environmentally induced reproductive inhibition (value is inherited by descendent classes) More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Detailed Description

The newt egg class - in pond.

Class Newt_Egg represents the egg stage of the newt in ponds. Each egg has a location in a pond polygon represented by it's home pond polygon reference (first entry in m_pondlist). The egg starts life at zero days old with zero day degrees. It ages each day ( see Newt_Egg::st_Develop ), and the temperature experiences is summed each day to create a cumulative day-degree sum. When this sum reaches a pre-defined number of day-degrees the egg hatches to produce a larva.

Constructor & Destructor Documentation

◆ Newt_Egg()

Newt_Egg::Newt_Egg ( int  a_x,
int  a_y,
vector< unsigned >  a_pond,
Landscape a_L,
Newt_Population_Manager a_NPM,
bool  a_reproinhib 
)

Newt_Egg constructor.

97  : Newt_Base( a_x, a_y, a_pond, a_L, a_NPM, a_reproinhib )
98 {
99  Init();
100 }
Newt_Base(int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib)
Newt constructor.
Definition: Newt.cpp:59
virtual void Init()
Newt_Egg Initialisation.
Definition: Newt.cpp:115

References Init().

◆ ~Newt_Egg()

Newt_Egg::~Newt_Egg ( void  )

Newt destructor.

104 {
105  ;
106 }

Member Function Documentation

◆ Init()

void Newt_Egg::Init ( void  )
virtual

Newt_Egg Initialisation.

116 {
117  m_AgeDegrees = 0;
118 }
double m_AgeDegrees
Definition: Newt.h:192

References m_AgeDegrees.

Referenced by Newt_Egg(), Newt_Larva::Newt_Larva(), ReInit(), and Newt_Larva::ReInit().

◆ InternalPesticideHandlingAndResponse()

void Newt_Egg::InternalPesticideHandlingAndResponse ( )

For handlng of class-specific pesticide effects.

This method is re-implemented from Newt_Base for any class which has pesticide response behaviour. If the body burden exceeds the trigger then an effect is tested for and implemented depending on the pesticide type.

1168  {
1173  // Test against the threshold level for Egg to determine if an effect needs to be tested for
1175  // We are above the PPP body burden threshold, so make a test for effect
1178  switch (tp) {
1179  case ttop_NoPesticide:
1180  break;
1181  case ttop_ReproductiveEffects: // Reproductive effects
1182  m_reproductiveinhibition = true;
1183  break;
1184  case ttop_AcuteEffects: // Acute mortality
1186  KillThis();
1187  break;
1188  case ttop_MultipleEffects:
1189  break;
1190  default:
1191  g_msg->Warn("Unknown pesticide type used in Newt_Female::InternalPesticideHandlingAndResponse() pesticide code ", int(tp));
1192  exit(47);
1193  }
1194  }
1195  }
1196 }
MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
@ toNewts_Die
Definition: Newt.h:75
TTypesOfPesticide SupplyPesticideType(void)
Definition: landscape.h:433
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
TTypeOfNewtState m_CurrentNewtState
Variable to record current behavioural state.
Definition: Newt.h:113
bool m_reproductiveinhibition
A flag to indicate environmentally induced reproductive inhibition (value is inherited by descendent ...
Definition: Newt.h:123
double m_body_burden
The current PPP body burden for use in pesticide testing mode.
Definition: Newt.h:121
static double m_EggPPPEffectProbability
The daily probability of effect if above m_EggPPPThreshold for eggs.
Definition: Newt.h:200
static double m_EggPPPThreshold
The threshold for effect of PPP on eggs.
Definition: Newt.h:196
virtual void KillThis()
Definition: PopulationManager.h:219
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
TTypesOfPesticide
Definition: landscape.h:66
@ ttop_NoPesticide
Definition: landscape.h:67
@ ttop_AcuteEffects
Definition: landscape.h:68
@ ttop_MultipleEffects
Definition: landscape.h:74
@ ttop_ReproductiveEffects
Definition: landscape.h:69

References g_msg, g_rand_uni, TAnimal::KillThis(), Newt_Base::m_body_burden, Newt_Base::m_CurrentNewtState, m_EggPPPEffectProbability, m_EggPPPThreshold, TAnimal::m_OurLandscape, Newt_Base::m_reproductiveinhibition, Landscape::SupplyPesticideType(), toNewts_Die, ttop_AcuteEffects, ttop_MultipleEffects, ttop_NoPesticide, ttop_ReproductiveEffects, and MapErrorMsg::Warn().

Referenced by st_Develop().

◆ ReInit()

void Newt_Egg::ReInit ( int  a_x,
int  a_y,
vector< unsigned >  a_pond,
Landscape a_L,
Newt_Population_Manager a_NPM,
bool  a_reproinhib 
)

ReInit for object pool.

109  {
110  Newt_Base::ReInit(a_x, a_y, a_pond, a_L, a_NPM, a_reproinhib);
111  Init();
112 }
void ReInit(int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib)
ReInit for object pool.
Definition: Newt.cpp:65

References Init(), and Newt_Base::ReInit().

Referenced by Newt_Larva::ReInit().

◆ st_Develop()

TTypeOfNewtState Newt_Egg::st_Develop ( void  )
protectedvirtual

Behavioural state development.

Determines whether the egg sucumbs to daily mortality using a probability test against a daily probability (input parameter), if so return toNewts_Die state.
Next if there is the need to test for pesticide effects then the body-burden is adjusted for yesterdays elimination, then pesticide at this location is determined and any intake stored. If the body-burden is greater than the threshold for effects, then InternalPesticideHandlingAndResponse is called and the impacts determined. If the egg survives:

  • The age is incremented
  • The sum of day degrees is increased by the mean temperature today
  • If the total sum of day degrees exceeds the parameter value held in m_EggDevelopmentThreshold, the egg should hatch and the state toNewts_NextStage is returned
  • If not fully developed the toNewts_Develop stage is returned and the process will be repeated the following day

Reimplemented in Newt_Larva.

149  {
163  // We need to test pesticide if m_test_pesticide is set
164  if (m_test_pesticide_egg) {
165  // Eliminate some/all of yesterdays body burden of PPP by multiplying by 1-the daily elimination rate
167  // Pick up the pesticide to add to the body burden
168  // This differs from the usual way of doing things because we assume mixing in pond water, so ask the pond.
172  }
173  m_Age++;
176  return toNewts_Develop;
177 }
@ toNewts_NextStage
Definition: Newt.h:69
@ toNewts_Develop
Definition: Newt.h:67
double SupplyTemp(void)
Definition: landscape.h:1386
double SupplyPondPesticide(int a_poly_index)
Get the pesticide concentration per liter from a pond (must be a pond index on calling)
Definition: landscape.h:761
static double m_EggDevelopmentDDTotal
Definition: Newt.h:99
static bool m_test_pesticide_egg
Flags to record whether we are in pesticide testing mode.
Definition: Newt.h:106
static double m_EggMortalityChance
Definition: Newt.h:102
Newt_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Newt.h:119
unsigned m_Age
Definition: Newt.h:115
vector< unsigned > m_pondlist
Definition: Newt.h:117
static double m_EggPPPElimRate
The daily proportion of PPP body burden that is not eliminated for eggs.
Definition: Newt.h:198
void InternalPesticideHandlingAndResponse()
For handlng of class-specific pesticide effects.
Definition: Newt.cpp:1168
double GetEggDDRateTransformation(double a_temperature)
Returns the value from the precalulated m_NewtEgg_DDTempRate to get effective day degrees.
Definition: Newt_Population_Manager.h:93

References g_rand_uni, Newt_Population_Manager::GetEggDDRateTransformation(), InternalPesticideHandlingAndResponse(), Newt_Base::m_Age, m_AgeDegrees, Newt_Base::m_body_burden, Newt_Base::m_CurrentNewtState, Newt_Base::m_EggDevelopmentDDTotal, Newt_Base::m_EggMortalityChance, m_EggPPPElimRate, TAnimal::m_OurLandscape, Newt_Base::m_OurPopulationManager, Newt_Base::m_pondlist, Newt_Base::m_test_pesticide_egg, Landscape::SupplyPondPesticide(), Landscape::SupplyTemp(), toNewts_Develop, toNewts_Die, and toNewts_NextStage.

Referenced by Step().

◆ st_NextStage()

TTypeOfNewtState Newt_Egg::st_NextStage ( void  )
protectedvirtual

Egg hatch.

Creates a new Newt_Larva object and passes the data from the young to it, then signals young object removal.

Reimplemented in Newt_Larva.

180  {
184  struct_Newt sN;
186  sN.L = m_OurLandscape;
187  sN.age = m_Age;
188  sN.x = m_Location_x;
189  sN.y = m_Location_y;
190  sN.pondrefs = m_pondlist;
192  m_OurPopulationManager->CreateObjects( tton_Larva, NULL, &sN,1 ); //
193  m_CurrentStateNo = -1;
194  m_StepDone = true;
195  return toNewts_Remove; // Not necessary, but for neatness
196 }
@ tton_Larva
Definition: Newt.h:50
@ toNewts_Remove
Definition: Newt.h:70
void CreateObjects(int ob_type, TAnimal *pvo, struct_Newt *data, int number)
Method for creating a new individual Newt.
Definition: Newt_Population_Manager.cpp:344
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225
Used for creation of a new Newt object.
Definition: Newt_Population_Manager.h:47
bool reproinhib
Holds a reproductive effect flag.
Definition: Newt_Population_Manager.h:64
vector< unsigned > pondrefs
Born x-coord.
Definition: Newt_Population_Manager.h:56
int y
y-coord
Definition: Newt_Population_Manager.h:54
int age
The newt age.
Definition: Newt_Population_Manager.h:50
int x
x-coord
Definition: Newt_Population_Manager.h:52
Landscape * L
Landscape pointer.
Definition: Newt_Population_Manager.h:60
Newt_Population_Manager * NPM
Newt_Population_Manager pointer.
Definition: Newt_Population_Manager.h:62

References struct_Newt::age, Newt_Population_Manager::CreateObjects(), struct_Newt::L, Newt_Base::m_Age, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Newt_Base::m_OurPopulationManager, Newt_Base::m_pondlist, Newt_Base::m_reproductiveinhibition, TALMaSSObject::m_StepDone, struct_Newt::NPM, struct_Newt::pondrefs, struct_Newt::reproinhib, toNewts_Remove, tton_Larva, struct_Newt::x, and struct_Newt::y.

Referenced by Step().

◆ Step()

void Newt_Egg::Step ( void  )
virtual

Newt_Egg Step code. This is called continuously until all animals report that they are 'DONE'.

Reimplemented from Newt_Base.

Reimplemented in Newt_Larva.

121  {
122  if (m_StepDone || m_CurrentStateNo == -1) return;
123  switch (m_CurrentNewtState) {
124  case toNewts_InitialState: // Initial state always starts with develop
126  break;
127  case toNewts_Develop:
128  m_CurrentNewtState = st_Develop(); // Will return movement or die
129  m_StepDone = true;
130  break;
131  case toNewts_NextStage:
132  st_NextStage();
133  break;
134  case toNewts_Die:
135  st_Dying(); // No return
136  m_StepDone = true;
137  break;
138  case toNewts_Remove:
139  m_CurrentStateNo = -1;
140  m_StepDone = true;
141  break;
142  default:
143  m_OurLandscape->Warn( "Newt_egg::Step()", " unknown state" );
144  exit( 1 );
145  }
146 }
@ toNewts_InitialState
Definition: Newt.h:66
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
void st_Dying(void)
Behavioural state dying.
Definition: Newt.cpp:87
virtual TTypeOfNewtState st_NextStage(void)
Egg hatch.
Definition: Newt.cpp:180
virtual TTypeOfNewtState st_Develop(void)
Behavioural state development.
Definition: Newt.cpp:149

References Newt_Base::m_CurrentNewtState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_Develop(), Newt_Base::st_Dying(), st_NextStage(), toNewts_Develop, toNewts_Die, toNewts_InitialState, toNewts_NextStage, toNewts_Remove, and Landscape::Warn().

Member Data Documentation

◆ m_AgeDegrees

double Newt_Egg::m_AgeDegrees
protected

A internal variable used to sum up the day-degrees experienced by the egg/larva

Referenced by Init(), Newt_Larva::Init(), st_Develop(), and Newt_Larva::st_Develop().

◆ m_EggPPPEffectProbability

double Newt_Egg::m_EggPPPEffectProbability = cfg_NewtEggPPPEffectProbability.value()
static

The daily probability of effect if above m_EggPPPThreshold for eggs.

Referenced by InternalPesticideHandlingAndResponse(), and Newt_Population_Manager::Newt_Population_Manager().

◆ m_EggPPPElimRate

double Newt_Egg::m_EggPPPElimRate = cfg_NewtEggPPPToxEliminationRate.value()
static

The daily proportion of PPP body burden that is not eliminated for eggs.

Referenced by Newt_Population_Manager::Newt_Population_Manager(), and st_Develop().

◆ m_EggPPPThreshold

double Newt_Egg::m_EggPPPThreshold = cfg_NewtEggPPPToxTrigger.value()
static

The threshold for effect of PPP on eggs.

Referenced by InternalPesticideHandlingAndResponse(), and Newt_Population_Manager::Newt_Population_Manager().


The documentation for this class was generated from the following files: